package com.water.app.Controller.account;

import com.water.app.Result;
import com.water.app.User;
import com.water.app.interfaces.account.userService;
import com.water.app.mapper.userMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/user")
public class userController {
    private static final Logger log = LoggerFactory.getLogger(userController.class);
    @Autowired
    private userService userService;
    @PostMapping("/updateUser")
    public Result updateUser(@RequestBody User user){
        log.info("user:{}",user);
        boolean result= userService.updateUserMsg(user);
        if(result){
            log.info("修改用户信息成功");
            return Result.success("修改用户信息成功");
        }else {
            log.info("修改用户信息失败");
            return Result.error("修改用户信息失败");
        }
    }
}
